import { defineStore } from "pinia";
interface stateTypes {
    language: string;
    theme: string;
    search: string;
}
export const useCommonStore = defineStore('common', {
    state: (): stateTypes => ({
        language: localStorage.getItem('mindspore-lang') || 'zh',
        theme: localStorage.getItem('mindspore-theme') || 'light',
        search: localStorage.getItem('mindspore-search') || '',
    }),
    actions: {
        setLanguage(language: string) {
            this.language = language;
        },
    },
});
